<script setup lang="ts">
import { ref } from 'vue';

// defineProps<{ msg: string }>();

const count = ref(0);
</script>

<template>
    <div class="header">
        <div class="logo">
            <img src="/logo.svg" alt="企业Logo" />
            <span>企业网站</span>
        </div>
        <el-menu mode="horizontal" :router="true" :default-active="$route.path" class="nav-menu">
            <el-menu-item index="/">首页</el-menu-item>
            <el-menu-item index="/about">关于我们</el-menu-item>
            <el-menu-item index="/products">产品服务</el-menu-item>
            <el-menu-item index="/news">新闻中心</el-menu-item>
            <el-menu-item index="/contact">联系我们</el-menu-item>
        </el-menu>
    </div>
</template>

<style scoped>
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.nav-menu {
    border-bottom: none;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        padding: 10px;
    }

    .nav-menu {
        width: 100%;
    }
}
</style>
